Driven by increasing usage of a variety of network applications, such as those involving the Internet, computer networks are of increasing interest. In order to couple portions of a network together or to couple networks together, network processors residing in switches, routers, and/or other components are typically used. The switches, routers, and/or other components allow packets to be transmitted through the network. However, different packets may be desired to be handled differently. For example, packets from certain sources may be refused entry to portions of the network. Other packets may be granted higher priority in transmission through the network.
In order to determine how packets are to be handled, the packets are classified. Packet classification typically includes using various rules and determining which of the rules apply to particular packets. Thus, packet classification includes defining various rules. For example, one rule might specify that packets having certain source addresses will be discarded if their destination address is for a portion of the network for which access is to be denied. In order to determine whether a particular rule applies to a particular packet in the network processor, the packet is compared with the criteria for the rules. Packet classification typically includes determining whether each incoming packet to the network processor matches the criteria for particular rules as well as defining the rules. In order to ensure that packet classification is performed as desired, a network administrator typically desires to manage the packet classification behavior of the network processors.
FIG. 1 depicts a block diagram of a conventional system 10 for packet classification in network processors. The system 10 includes a conventional host processor 20 used by a network administrator and conventional network processors 30, 40, and 50. The conventional host processor 20 typically includes a conventional packet classification application 22 that is developed at least in part by the owner of the conventional system 10. The network administrator uses the conventional packet classification application 22 to manage the packet classification behavior of the conventional network processors 30, 40, and 50 in the conventional system 10.
The conventional network processors 30, 40, and 50 are typically purchased by the owner of the conventional system 10. The conventional network processors 30, 40, and 50 each includes conventional software and/or firmware 32, 42, and 52, respectively, that may be different. For example, the conventional network processors 30, 40, and 50 may include different versions of a particular model of network processor from a particular vendor and/or other model(s) of network processor that may be from other vendors. Thus, the conventional network processors 30 and 40 are depicted as having software and/or firmware 32 and 42 that are different versions of a Model X network processor, while the software and/or firmware 52 of the conventional network processor 50 is a Model Y network processor. For example, typically the conventional software and/or firm ware 32, 42, and 52 used in packet classification is burned into conventional network processor 30, 40, and 50 so that the network processor handles certain types of packets in a particular way, using particular rules. Because the conventional network processors 30, 40, and 50 are thus very distinct, each conventional network processor 30, 40, and 50 utilizes conventional application program interfaces (APIs) 12, 14, and 16, respectively, that are specific to the particular software and/or firmware 32, 42, and 52, respectively.
The conventional packet classification application 22 is used to manage the packet classification behavior of the conventional network processors 30, 40, and 50, respectively. The conventional packet classification application 22 thus includes a corresponding set of conventional behaviors 24, 26, and 28 for each set of the conventional APIs 12, 14, and 16, respectively. The conventional APIs 12, 14, and 16 are designed to communicate with the conventional behaviors 32, 42, and 52, respectively. The conventional APIs 12, 14, and 16 are also used to control the corresponding software and/or firmware 32, 42, and 52, respectively. Thus, using the conventional behaviors 24, 26, and 28 corresponding to the conventional APIs 12, 14, and 16, respectively, the conventional packet classification application 22 can control the packet classification behavior of each of the conventional network processors 30, 40, and 50, respectively.
Although the conventional system 10 functions, one of ordinary skill in the art will readily recognize that the conventional system is difficult to scale. The conventional network processors 30, 40, and 50 are typically heterogeneous in nature. Because the conventional network processors 30, 40, and 50 are heterogeneous, the conventional network processors may include different versions of a particular model of network processor and/or different models of network processor. In addition, the method of specifying the packet classification behavior of each conventional network processor 30, 40, and 50 may differ widely. Thus, the software and/or firmware 32, 42, and 52 of different network processors typically differ. The APIs 12, 14, and 16 thus also differ. Consequently, the corresponding behaviors 24, 26, and 28 of the conventional packet classification application 22 are distinct. One of ordinary skill in the art will also readily recognize that the conventional system 10 may actually include a large number of network processors. Consequently, the number of conventional APIs 12, 14, and 16 with which the conventional packet classification application 22 must be compatible may be large. As a result, the number of distinct conventional behaviors used by the conventional host processor 20 and developed by the owner of the conventional system 10, such as the conventional behaviors 24, 26, and 28, may be large. As a result, the conventional packet classification application 22 may be complex and include an amalgamation of a variety of behaviors, one for each model and/or version of conventional network processor. It may thus be difficult to incorporate new network processors, which may have software and/or, firmware and thus APIs not previously supported. The conventional system 10 is, therefore, difficult to scale. Because of difficulties in incorporating new software and/or firmware and their corresponding APIs, evolving the conventional packet classification application 22 and, therefore, the conventional system 10 to utilize improved network processors may be problematic. Furthermore, because supporting a variety of conventional behaviors 24, 26, and 28 makes the conventional packet classification application 22 more complex, the conventional system 10 may be subject to higher maintenance costs.
Accordingly, what is needed is a system and method for allowing a host to control packet classification behavior of a network processor in a scalable, flexible manner. The present invention addresses such a need.